#include <QIODevice>
#include <QString>
#include "ISimpleChannel.h"

void ISimpleChannel::HasData()
{  
    emit data(Receive(DataAvailable()));
}

unsigned ForceWrite(QIODevice* io, const QByteArray& data)
{
    unsigned offset = 0, bytes = 0;
 
    while (bytes = io->write(data.data() + offset, data.size() - offset))
        offset += bytes;

    return offset;
}